package com.api.shopapi.service.impl;


import com.api.shopapi.entity.dto.GoodsBusinessCodeDTO;
import com.api.shopapi.mapper.GoodsClassMapper;
import com.api.shopapi.service.GoodsBusinessCodeService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("GoodsBusinessCodeServiceImplOne")
public class GoodsBusinessCodeServiceImpl implements GoodsBusinessCodeService {

    @Autowired
    private GoodsClassMapper goodsClassMapper;


    @Override
    public int getBusinessGoodsCode(String businessCode,String GoodsCode, String startTime, String endTime) {
        return goodsClassMapper.getBusinessGoodsCode(businessCode,GoodsCode,startTime,endTime);
    }

    @Override
    public PageInfo<GoodsBusinessCodeDTO> getList(int pageIndex, int pageSize, String businessCode, String startTime, String endTime) {
        PageHelper.startPage(pageIndex,pageSize);
        List<GoodsBusinessCodeDTO> goodsRecordList = goodsClassMapper.getPage(businessCode,startTime,endTime);
        return new PageInfo<>(goodsRecordList);
    }


}
